<html lang="en"><head>
    <meta charset="UTF-8">


    <link rel="apple-touch-icon" type="image/png" href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png">

    <meta name="apple-mobile-web-app-title" content="CodePen">

    <link rel="shortcut icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico">

    <link rel="mask-icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/logo-pin-b4b4269c16397ad2f0f7a01bcdf513a1994f4c94b8af2f191c09eb0d601762b1.svg" color="#111">






    <title>Only CSS: Shooting Star</title>

    <link rel="canonical" href="https://codepen.io/YusukeNakaya/pen/XyOaBj">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Anton">

    <style>
        body {
            background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
            height: 100vh;
            overflow: hidden;
            display: flex;
            font-family: "Anton", sans-serif;
            justify-content: center;
            align-items: center;
        }

        .night {
            position: relative;
            width: 100%;
            height: 100%;
            transform: rotateZ(45deg);
        }

        .shooting_star {
            position: absolute;
            left: 50%;
            top: 50%;
            height: 2px;
            background: linear-gradient(-45deg, #5f91ff, rgba(0, 0, 255, 0));
            border-radius: 999px;
            filter: drop-shadow(0 0 6px #699bff);
            -webkit-animation: tail 3000ms ease-in-out infinite, shooting 3000ms ease-in-out infinite;
            animation: tail 3000ms ease-in-out infinite, shooting 3000ms ease-in-out infinite;
        }
        .shooting_star::before {
            content: "";
            position: absolute;
            top: calc(50% - 1px);
            right: 0;
            height: 2px;
            background: linear-gradient(-45deg, rgba(0, 0, 255, 0), #5f91ff, rgba(0, 0, 255, 0));
            transform: translateX(50%) rotateZ(45deg);
            border-radius: 100%;
            -webkit-animation: shining 3000ms ease-in-out infinite;
            animation: shining 3000ms ease-in-out infinite;
        }
        .shooting_star::after {
            content: "";
            position: absolute;
            top: calc(50% - 1px);
            right: 0;
            height: 2px;
            background: linear-gradient(-45deg, rgba(0, 0, 255, 0), #5f91ff, rgba(0, 0, 255, 0));
            transform: translateX(50%) rotateZ(45deg);
            border-radius: 100%;
            -webkit-animation: shining 3000ms ease-in-out infinite;
            animation: shining 3000ms ease-in-out infinite;
            transform: translateX(50%) rotateZ(-45deg);
        }
        .shooting_star:nth-child(1) {
            top: calc(50% - -194px);
            left: calc(50% - 193px);
            -webkit-animation-delay: 6691ms;
            animation-delay: 6691ms;
        }
        .shooting_star:nth-child(1)::before, .shooting_star:nth-child(1)::after {
            -webkit-animation-delay: 6691ms;
            animation-delay: 6691ms;
        }
        .shooting_star:nth-child(2) {
            top: calc(50% - 99px);
            left: calc(50% - 157px);
            -webkit-animation-delay: 8023ms;
            animation-delay: 8023ms;
        }
        .shooting_star:nth-child(2)::before, .shooting_star:nth-child(2)::after {
            -webkit-animation-delay: 8023ms;
            animation-delay: 8023ms;
        }
        .shooting_star:nth-child(3) {
            top: calc(50% - 38px);
            left: calc(50% - 271px);
            -webkit-animation-delay: 9118ms;
            animation-delay: 9118ms;
        }
        .shooting_star:nth-child(3)::before, .shooting_star:nth-child(3)::after {
            -webkit-animation-delay: 9118ms;
            animation-delay: 9118ms;
        }
        .shooting_star:nth-child(4) {
            top: calc(50% - 21px);
            left: calc(50% - 118px);
            -webkit-animation-delay: 1614ms;
            animation-delay: 1614ms;
        }
        .shooting_star:nth-child(4)::before, .shooting_star:nth-child(4)::after {
            -webkit-animation-delay: 1614ms;
            animation-delay: 1614ms;
        }
        .shooting_star:nth-child(5) {
            top: calc(50% - -35px);
            left: calc(50% - 287px);
            -webkit-animation-delay: 1218ms;
            animation-delay: 1218ms;
        }
        .shooting_star:nth-child(5)::before, .shooting_star:nth-child(5)::after {
            -webkit-animation-delay: 1218ms;
            animation-delay: 1218ms;
        }
        .shooting_star:nth-child(6) {
            top: calc(50% - -83px);
            left: calc(50% - 209px);
            -webkit-animation-delay: 7045ms;
            animation-delay: 7045ms;
        }
        .shooting_star:nth-child(6)::before, .shooting_star:nth-child(6)::after {
            -webkit-animation-delay: 7045ms;
            animation-delay: 7045ms;
        }
        .shooting_star:nth-child(7) {
            top: calc(50% - -96px);
            left: calc(50% - 258px);
            -webkit-animation-delay: 1684ms;
            animation-delay: 1684ms;
        }
        .shooting_star:nth-child(7)::before, .shooting_star:nth-child(7)::after {
            -webkit-animation-delay: 1684ms;
            animation-delay: 1684ms;
        }
        .shooting_star:nth-child(8) {
            top: calc(50% - 53px);
            left: calc(50% - 247px);
            -webkit-animation-delay: 6346ms;
            animation-delay: 6346ms;
        }
        .shooting_star:nth-child(8)::before, .shooting_star:nth-child(8)::after {
            -webkit-animation-delay: 6346ms;
            animation-delay: 6346ms;
        }
        .shooting_star:nth-child(9) {
            top: calc(50% - -21px);
            left: calc(50% - 198px);
            -webkit-animation-delay: 5185ms;
            animation-delay: 5185ms;
        }
        .shooting_star:nth-child(9)::before, .shooting_star:nth-child(9)::after {
            -webkit-animation-delay: 5185ms;
            animation-delay: 5185ms;
        }
        .shooting_star:nth-child(10) {
            top: calc(50% - 175px);
            left: calc(50% - 228px);
            -webkit-animation-delay: 3163ms;
            animation-delay: 3163ms;
        }
        .shooting_star:nth-child(10)::before, .shooting_star:nth-child(10)::after {
            -webkit-animation-delay: 3163ms;
            animation-delay: 3163ms;
        }
        .shooting_star:nth-child(11) {
            top: calc(50% - 139px);
            left: calc(50% - 110px);
            -webkit-animation-delay: 5983ms;
            animation-delay: 5983ms;
        }
        .shooting_star:nth-child(11)::before, .shooting_star:nth-child(11)::after {
            -webkit-animation-delay: 5983ms;
            animation-delay: 5983ms;
        }
        .shooting_star:nth-child(12) {
            top: calc(50% - 136px);
            left: calc(50% - 248px);
            -webkit-animation-delay: 7127ms;
            animation-delay: 7127ms;
        }
        .shooting_star:nth-child(12)::before, .shooting_star:nth-child(12)::after {
            -webkit-animation-delay: 7127ms;
            animation-delay: 7127ms;
        }
        .shooting_star:nth-child(13) {
            top: calc(50% - 200px);
            left: calc(50% - 56px);
            -webkit-animation-delay: 9677ms;
            animation-delay: 9677ms;
        }
        .shooting_star:nth-child(13)::before, .shooting_star:nth-child(13)::after {
            -webkit-animation-delay: 9677ms;
            animation-delay: 9677ms;
        }
        .shooting_star:nth-child(14) {
            top: calc(50% - 36px);
            left: calc(50% - 90px);
            -webkit-animation-delay: 1977ms;
            animation-delay: 1977ms;
        }
        .shooting_star:nth-child(14)::before, .shooting_star:nth-child(14)::after {
            -webkit-animation-delay: 1977ms;
            animation-delay: 1977ms;
        }
        .shooting_star:nth-child(15) {
            top: calc(50% - -141px);
            left: calc(50% - 224px);
            -webkit-animation-delay: 7630ms;
            animation-delay: 7630ms;
        }
        .shooting_star:nth-child(15)::before, .shooting_star:nth-child(15)::after {
            -webkit-animation-delay: 7630ms;
            animation-delay: 7630ms;
        }
        .shooting_star:nth-child(16) {
            top: calc(50% - 11px);
            left: calc(50% - 28px);
            -webkit-animation-delay: 6409ms;
            animation-delay: 6409ms;
        }
        .shooting_star:nth-child(16)::before, .shooting_star:nth-child(16)::after {
            -webkit-animation-delay: 6409ms;
            animation-delay: 6409ms;
        }
        .shooting_star:nth-child(17) {
            top: calc(50% - -70px);
            left: calc(50% - 175px);
            -webkit-animation-delay: 7190ms;
            animation-delay: 7190ms;
        }
        .shooting_star:nth-child(17)::before, .shooting_star:nth-child(17)::after {
            -webkit-animation-delay: 7190ms;
            animation-delay: 7190ms;
        }
        .shooting_star:nth-child(18) {
            top: calc(50% - -133px);
            left: calc(50% - 270px);
            -webkit-animation-delay: 6348ms;
            animation-delay: 6348ms;
        }
        .shooting_star:nth-child(18)::before, .shooting_star:nth-child(18)::after {
            -webkit-animation-delay: 6348ms;
            animation-delay: 6348ms;
        }
        .shooting_star:nth-child(19) {
            top: calc(50% - 34px);
            left: calc(50% - 94px);
            -webkit-animation-delay: 126ms;
            animation-delay: 126ms;
        }
        .shooting_star:nth-child(19)::before, .shooting_star:nth-child(19)::after {
            -webkit-animation-delay: 126ms;
            animation-delay: 126ms;
        }
        .shooting_star:nth-child(20) {
            top: calc(50% - 147px);
            left: calc(50% - 37px);
            -webkit-animation-delay: 9319ms;
            animation-delay: 9319ms;
        }
        .shooting_star:nth-child(20)::before, .shooting_star:nth-child(20)::after {
            -webkit-animation-delay: 9319ms;
            animation-delay: 9319ms;
        }

        @-webkit-keyframes tail {
            0% {
                width: 0;
            }
            30% {
                width: 100px;
            }
            100% {
                width: 0;
            }
        }

        @keyframes tail {
            0% {
                width: 0;
            }
            30% {
                width: 100px;
            }
            100% {
                width: 0;
            }
        }
        @-webkit-keyframes shining {
            0% {
                width: 0;
            }
            50% {
                width: 30px;
            }
            100% {
                width: 0;
            }
        }
        @keyframes shining {
            0% {
                width: 0;
            }
            50% {
                width: 30px;
            }
            100% {
                width: 0;
            }
        }
        @-webkit-keyframes shooting {
            0% {
                transform: translateX(0);
            }
            100% {
                transform: translateX(300px);
            }
        }
        @keyframes shooting {
            0% {
                transform: translateX(0);
            }
            100% {
                transform: translateX(300px);
            }
        }
        @-webkit-keyframes sky {
            0% {
                transform: rotate(45deg);
            }
            100% {
                transform: rotate(405deg);
            }
        }
        @keyframes sky {
            0% {
                transform: rotate(45deg);
            }
            100% {
                transform: rotate(405deg);
            }
        }
    </style>

    <script>
        window.console = window.console || function(t) {};
    </script>



</head>

<body translate="no">
<div class="night">
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
    <div class="shooting_star"></div>
</div>






</body></html>